<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  *{
    padding:0;
    margin: 0;
  }
  .box1{
    height: 100px;
    padding: 10px;
    background: red;
    margin-bottom: 10px;
  }
  .box2{
    height: 100px;
    padding: 10px;
    background: yellow;
    margin-top: 20px;
  }
</style>
<body>
  <div class="box1">
    1
  </div>
  <div class="box2">
    2
  </div>
</body>
</html>